package io;

import java.io.*;

public class Demo6 {

    public static void main(String[] args) throws IOException {
        try(OutputStream os = new FileOutputStream("d:/test.txt") ) {
            try (OutputStreamWriter osWriter = new OutputStreamWriter(os,"utf-8")){
                try(PrintWriter writer = new PrintWriter(osWriter)) {
                    writer.print(true);
                    writer.print('6');
                    writer.print(6);
                    writer.println("哈哈哈哈");
                    writer.printf("这是输出的内容%s\n","hello world");
                    writer.flush();
                }
            }
        }

    }
}
